
# React Native 
 
## RN填坑

1、不要使用最新的hermes 0.73.6, `bigInt` 存在找不到 `toString`的实现。
``` 
export HERMES_ENGINE_TARBALL_PATH=~/Downloads/react-native-artifacts-0.71.3-hermes-ios-debug.tar.gz
pod install
```

2、image 显示gif时 圆角在android上不生效。



3、Image 占位图

``` JavaScript
import React from 'react';
import {Image, StyleSheet, View, ViewPropTypes} from 'react-native';
import PropTypes from 'prop-types';

class ImageView extends React.PureComponent {
    static propTypes = {
        source: PropTypes.object,
        style: ViewPropTypes.style,
        placeholderSource: PropTypes.number.isRequired,
    };
    state: {
        loading: boolean;
    };

    constructor(props) {
        super(props);
        this.state = {loading: true,};
    }

    render() {
        return (<View style={this.props.style}>
                <Image style={[this.props.style, styles.imageStyle]} source={this.props.source} onLoad={() => this.setState({loading: false})}/>
                {this.state.loading ?
                    <Image style={[this.props.style, styles.imageStyle]} source={this.props.placeholderSource}/> : null}
            </View>
        );
    }

}

const styles = StyleSheet.create({
    imageStyle: {
        position: 'absolute',
        top: 0,
        right: 0,
        left: 0,
        bottom: 0
    }
});

export default ImageView;
```

``` JavaScript
<ImageView style={styles.icon} source={{uri: imageUrl}} placeholderSource={require("./img/icon.png")}/>
```

``` JavaScript 
 if you have use_frameworks! enabled, Flipper will not work
```